package com.zuihai.app.mvp.model.api.service;

import com.zuihai.app.mvp.model.entity.BaseJson;
import com.zuihai.app.mvp.model.entity.FindItem;
import com.zuihai.app.mvp.model.entity.HomeItem;
import com.zuihai.app.mvp.model.entity.MyFootCollectCheckResult;
import com.zuihai.app.mvp.model.entity.SearchHot;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by Administrator on 2017/6/21 0021.
 */

public interface SearchService {

    /**
     * 搜索全部
     * @param searchStr
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("Sousuo_clickInq")
    Observable<BaseJson<MyFootCollectCheckResult>> searchAll(@Field("field") String searchStr,
                                                             @Field("my_id") String userId,
                                                             @Field("page") int pageIndex);


    /**
     * 搜索头条文章
     * @param searchStr
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("Sousuo_clickInq?fenlei_Tag=1")
    Observable<BaseJson<HomeItem>> searchHeadline(@Field("field") String searchStr, @Field("my_id") String userId, @Field("page") int pageIndex);

    /**
     * 搜索发现秘密
     * @param searchStr
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("Sousuo_clickInq?fenlei_Tag=2")
    Observable<BaseJson<FindItem>> searchSecret(@Field("field") String searchStr, @Field("my_id") String userId, @Field("page") int pageIndex);

    /**
     * 搜索商品服务
     * @param searchStr
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("Sousuo_clickInq?fenlei_Tag=3")
    Observable<BaseJson<FindItem>> searchCommodity(@Field("field") String searchStr, @Field("my_id") String userId, @Field("page") int pageIndex);

    /**
     * 搜索店铺去处
     * @param searchStr
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("Sousuo_clickInq?fenlei_Tag=4")
    Observable<BaseJson<FindItem>> searchShop(@Field("field") String searchStr, @Field("my_id") String userId, @Field("page") int pageIndex);

    /**
     * 获取热门
     * @return
     */
    @POST("Remen_sousuoInq")
    Observable<BaseJson<SearchHot>> searchHot();
}
